//
//  LoadMoreView.m
//  SmartRebate
//
//  Created by Yuan on 13-3-9.
//  Copyright (c) 2013年 unionpaysmart.com. All rights reserved.
//

#import "LoadMoreView.h"

@implementation LoadMoreView

- (id)initWithFrame:(CGRect)frame
{
    self = [super initWithFrame:frame];
    if (self)
    {
        titleLbl = [[UILabel alloc]initWithFrame:CGRectMake(80, 9, 145, 21)];
        [titleLbl setText:HYLocalizedString(@"加载更多...")];
        [titleLbl setTextColor:[UIColor lightGrayColor]];
        [titleLbl setBackgroundColor:[UIColor clearColor]];
        [titleLbl setTextAlignment:UITextAlignmentCenter];
        [self addSubview:titleLbl];
        
        activity = [[UIActivityIndicatorView alloc]initWithFrame:CGRectMake(52, 11, 20, 20)];
        [activity stopAnimating];
        [activity setHidesWhenStopped:YES];
        [activity setActivityIndicatorViewStyle:UIActivityIndicatorViewStyleGray];
        [self addSubview:activity];        
    }
    return self;
}

-(void)dealloc
{
    titleLbl = nil;
    activity = nil;
}

-(void)setTipTitle:(NSString *)title
{
    [titleLbl setText:title];
}

-(void)stopActivity
{
    [activity stopAnimating];
}

-(void)startActivity
{
    [activity startAnimating];
}


/*
// Only override drawRect: if you perform custom drawing.
// An empty implementation adversely affects performance during animation.
- (void)drawRect:(CGRect)rect
{
    // Drawing code
}
*/

@end
